Repository navigation
refactor(ui): co-locate component styles and split Deck and Panel out of the full player - #472
Merged
Merged
Conversation
Feeds are always cached since #468. The constructor still accepted a cache option that nothing read, and eight view tests still passed it.
The headset's Next in queue read the queue store and called play inline in bindMediaSession. PlayerController now owns it, beside play and the natural end's queue advance.
Since #470, PodNotes saves on its own once it can write data.json again. The Notice after an import whose final save failed still told the user to change a setting to save again.
…nel out of Player
PodcastView.svelte held 1,300 lines of page and component CSS in one global
block. Each component now carries its own styles, anchored on its own root
class with the `.root :global {}` pattern the shell already used. The shell
keeps its tokens, its layout, the Obsidian DOM rules and the classes several
components share.
Player.svelte loses the deck (title, scrubber, transport, capture bar) to
Deck.svelte, and ChaptersPanel and UpNextPanel share their chrome through
Panel.svelte. Cover draws a local file's tile, and SearchField takes the
first run's large variant, so no page reaches into them for it.
Variants of the shared .pn-iconbtn and .pn-btn classes win by specificity
instead of by stylesheet order.
The Chapters and Up next tabs follow the ARIA tabs pattern: Left and Right move focus to the previous or next tab and wrap, Home and End go to the first and last, and the focused tab shows its panel. Only the selected tab is in the Tab order.
…t reduced motion In fullscreen the video frame's fullscreen button stayed visible and did nothing. It now hides there; Escape leaves fullscreen. The play button's 120 ms press transition ran even when the system asks for reduced motion. It now presses without a transition then.
screens.mjs grew past 1,100 lines. It keeps its usage header, the verb dispatch and set; the instance calls, the seeded scenes and the contact sheet move to screens/instance.mjs, screens/scenes.mjs and screens/sheet.mjs. The code moved verbatim apart from imports, exports and the paths that moved one directory down.
…to EpisodeRow On a touch device Obsidian adds .mobile-tap to a tapped button, and its button:not(.clickable-icon).mobile-tap rule paints a fill. Search results, playlist rows, chapter rows and Up next's Edit button keep the specificity that resisted it, and the mini player's open button and the rail's add button keep the plain scoped rules that let it through. Queue rows are an EpisodeRow variant (queue, dragging) instead of rules QueueList laid over EpisodeRow and Cover. Deck no longer takes `wide`: the player passes no onchapters when the chapter name cannot open a panel. .pn-alt moves whole into AddPodcastPage, and the shell's head and back button rules move from the shared block to its layout.
Deploying podnotes with
|
| Latest commit: |
af605ca
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://53b0007e.podnotes.pages.dev |
| Branch Preview URL: | https://refactor-ui-structure.podnotes.pages.dev |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
The v3 view grew in three places that are hard to read.
PodcastView.sveltecarried about 1,300 lines of page and component CSS in one global block.Player.sveltewas 916 lines. The verify skill'sscreens.mjspassed 1,100 lines. This PR restructures them so each component owns its styles. Every screen stays pixel-identical, apart from three small fixes and one keyboard addition.What changed
.root :global {}pattern the shell already used. The shell keeps its tokens, its layout, the rules Obsidian's DOM needs, and the classes several components share (PodcastView.svelte1,552 → 739 lines).Player.svelte(916 → 530 lines) hands the title, scrubber, transport and capture bar toDeck.svelte.ChaptersPanelandUpNextPanelshare their chrome throughPanel.svelte. The headset's Next in queue moves frombindMediaSessionintoPlayerController.playNext.screens.mjs(1,128 → 189 lines) splits intoscreens/instance.mjs,screens/scenes.mjsandscreens/sheet.mjs, verbatim apart from imports and paths. The ignoredFeedRepositorycacheoption and its 8 frozen test callers are gone.Behavior changes:
Scope
docs/scripts/screenshots.mjsalone. It drives the v2 UI, and the release docs pass rewrites it.Where a component styles a child's markup
Each case is one the parent's layout decides:
EpisodeRow,AddPodcastPage(results),LibraryPage(grid cards) andEpisodesPage(hero) size theCoverthey place.Panelcenters the empty state its list shows.Playerstyles the<video>element thatplayer.videoStageinserts.SearchFieldin its head and lets a page's nav list bleed into the page padding.Queue rows are an
EpisodeRowvariant (queue,dragging) instead of rules inQueueList.Tradeoffs
.pn-iconbtn.pn-grip, now carries abuttontype selector. It wins by specificity instead of stylesheet order, and still loses to the shared:hover.button:not(.clickable-icon).mobile-tap. The mini player's open button and the rail's add-podcast button stay plain scoped rules, so they still show Obsidian's tap fill as before.svelte:elementwould have mergedPanel's two branches but costs 1.9K gzip.Blast radius
The whole PodNotes view restyles through new selectors. A cascade mistake would show as a wrong size, color or hover state. The pixel and computed-style comparisons below cover every captured state, at rest, under hover, active and focus, and under Obsidian's touch class.
main.jsgzip goes from 98,345 to 98,906 bytes (+561, under the 100,000 gate).Verification
screens.mjscaptures the same shots as the old one on the same bundle.:hover,:activeand:focus-visibleforced, and with Obsidian's touch classmobile-tapon every tappable element, master vs head: all 68 state-widths identical. The search results' new wrapper is folded out of the element paths for that comparison. In the now-playing sidebar state, one master snapshot caught master's capture buttons at the shared.pn-btnheight (30 px instead of 36 px): master's.pn-player .pn-capties.pn-btnand wins only by stylesheet order, andbutton.pn-capno longer depends on it. A settled master snapshot of that state matches.transform 0.12son master andnoneon head; in fullscreen the button shows (32 × 32) on master and is hidden on head.npm run lint,format:check,typecheck,build,test(2,549 passed),test:tooling(13 passed),docs:build, andtest:e2eon a fresh vault (176 of 176 passed), all on Node 22.23.2.Mutations
Each wrong alternative below fails the named test:
PlayerController.test.tsplayNext,mediaSession.test.tsNext in queueplay()doesPlayer.test.ts"arrow keys, Home and End move focus between the tabs"reducedMotion.test.tsno-preferencePodNotesSettingsTab.import.test.ts"keeps the import and says it saves later"Docs at release
Fullscreen on master (left) and on this branch (right), in Obsidian 1.14.4: